package com.example.springbootdemo15_redis.service;

import com.example.springbootdemo15_redis.entity.AccoutEntity;
import com.example.springbootdemo15_redis.jpa.AccountJPA;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@CacheConfig(cacheNames = "account")
public class AccountService {
    @Autowired
    private AccountJPA accountJPA;

    @Cacheable
    public List<AccoutEntity> list(){
        return accountJPA.findAll();
    }


}
